#ifndef __Skybox_H__
#define __Skybox_H__

#include "d3dheaders.h"
#include "Texture.h"
#include "Camera.h"
#include "Renderable.h"

namespace KEngine
{

class SceneManager;
class Skybox : public Renderable
{
public:
	enum SkyboxPlane
	{
		SKYBOX_PLANE_FRONT,
		SKYBOX_PLANE_RIGHT,
		SKYBOX_PLANE_BACK,
		SKYBOX_PLANE_LEFT,
		SKYBOX_PLANE_TOP,
		SKYBOX_PLANE_BOTTOM
	};

	struct VERTEX
	{
		float x, y, z;
		float u, v;

		VERTEX() {}
		VERTEX(float posX, float posY, float posZ, float texU, float texV) : x(posX), y(posY), z(posZ), u(texU), v(texV) {}

		static const DWORD FVF = D3DFVF_XYZ | D3DFVF_TEX1;
	};

public:
	Skybox();
	virtual ~Skybox();

	bool create(float sizeX, float sizeY, float sizeZ);
	bool setTexture(SkyboxPlane plane, const char* filename);
	virtual void render(Camera* camera, TimeValue t);

protected:
	float mSizeX, mSizeY, mSizeZ;
	VERTEX* mVerties;
	Texture* mTextures[6];

	friend class SceneManager;
	SceneManager* _scene;

};

}

#endif 